<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="__PUBLIC__/home/js/jquery-1.9.1.min.js"></script> 
<script type="text/javascript" src="__PUBLIC__/home/js/size.js"></script>
<include file="Public/title" />
    <style type="text/css">
        .search{float:right;margin-right:30px;}
        .form_up{float: left; height: 50px;width: 400px;padding-left: 20px;padding-top: 10px;}
    </style>
</head>

<body>
<div class="mainWrap">
    <!--标题-->
    <form action="{:U('sync_agent')}" method="post" enctype="multipart/form-data" id="upForm">
    <div class="mainWrapHeader">
        <h1 class="mainWrapTit">
            {$seotitle}
                <a href="{:U('add')}" class="btn btn_edit"><span>添加</span></a>
        </h1>       
        
        <!-- <form enctype="multipart/form-data" id="upForm"> -->
        <div class="form_up">
            <input type="file" name="file" id="file" >
            <input id="upExcel" type="button" value="导入" class="submit">
        </div>
        <!-- </form> -->
        
    </div>
    </form>

    

    <!--标题-->
    
    <div class="mainWrapBd">
        <form action="{:U('batchDo')}" method="post" name="doForm" onsubmit="return batchConfirm(this);">
        <!--列表-->
        <table cellpadding="0" cellspacing="0" border="0" class="stdtable stdtablelist">
            <colgroup>
                <col style="width:50px;" />
                <col />
                <col />
                <col />
                <col />
                <col />
            </colgroup>
            <thead>
                <tr>
                    <th class="center">ID</th>
                    <th>任务名称</th>
                    <th>所属项目</th>
                    <th>任务截止时间</th>
                    <th>跟进人员</th>
                    <th>抄送人员</th>
                    <th>当前状态</th>
                    <th>备注</th>      
                    <th>添加时间</th>
                    <th>操作</th>
     
                </tr>
            </thead>
            <tbody>
                <volist name="pages['lists']" id="fo">
                <tr>
                    <td align="center">{$fo['id']}</td>
                    <td>{$fo['name']}</td>
                    <td>{$fo['project_name']}</td>
                    <td>{$fo['end_time']|date='Y/m/d H:i',###}</td>
                    <td>                        
                        <?php echo get_name_info($fo['follow_user_id']);?>                        
                    </td>
                    <td><?php echo get_name_info($fo['cc_user_id']);?></td>  
                    <td>
                        <if condition="$fo['status'] eq 1">已完成</if>
                        <if condition="$fo['status'] eq 2">进行中</if>
                        <if condition="$fo['status'] eq 3">非正常关闭</if>
                        <if condition="$fo['status'] eq 4">未完成关闭</if>
                    </td>              
                    <td>{$fo['remark']}</td>
                    <td>{$fo['add_time']|date='Y/m/d H:i',###}</td>
                    <td>
                        <a href="{:U('edit',array('id'=>$fo['id']))}">修改</a> &nbsp; 
                        <a href="{:U('delete',array('id'=>$fo['id']))}" onclick="return confirm('确认删除吗？')">删除</a> &nbsp;
                    </td>                       
                </tr>
                </volist>
                <if condition="$pages['total'] eq 0">
                <tr>
                    <td align="center" class="data-nothing" colspan="9">暂无相关信息</td>
                </tr>
                </if>
            </tbody>
        </table>
        <!--列表-->
        
        <!--工具-->
        <div class="tableTools clearfix">
            <div class="tableOptions fl">
            </div>
            <div class="fr">
                {$pages['show']}
            </div>
        </div>
        <!--工具-->
        </form>
    </div>
</div>
</body>
<script type="text/javascript">
    $(function(){
        // document.getElementById('search_btn').onclick = function(){
        //     var key = document.getElementById('key').value;
        //     location.href = "{:U('Seller/index')}?key=" + key;
        // }

        $('#upExcel').click(function(){
            var formData = new FormData($('#upForm'));
            formData.append('file',$(':file')[0].files[0]);
            $.ajax({
                url :  "{:U('upFile')}",
                type : 'post',
                data : formData,
                contentType: false,
                processData: false,
                dataType : 'json',
                success : function (data, status) {
                    alert(data.info);
                    if(data.status){
                        location.href = data.url;
                    }
                },
                fail : function (err, status) {
                    console.log(err)
                }
            })
        })
    })
</script>
</html>